package com.ruoyi.system.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

/**
 * 核酸表
 * @TableName nucleic_acid
 */
@TableName(value ="nucleic_acid")
@Data
public class NucleicAcid implements Serializable {
    /**
     * id自增核酸
     */
    @Excel(name = "核酸id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 检测结果0阴性1阳性
     */
    @Excel(name = "检测结果0阴性1阳性")
    @TableField(value = "detection_result")
    private String detectionResult;

    /**
     * 检测时间
     */
    @Excel(name = "检测时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "detection_time")
    private Date detectionTime;


    /**
     * 创建时间
     */
    @Excel(name = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)//创建与修改时自动填充
    private Date createTime;

    /**
     * 更新时间
     */
    @Excel(name = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)//创建与修改时自动填充
    private Date updateTime;

    /**
     * 逻辑删除1删除0正常
     */
    @Excel(name = "逻辑删除1删除0正常")
    @TableField(value = "is_delete")
    private Integer isDelete;

    /**
     * 隔离人id
     */
    @Excel(name = "隔离人id")
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 检测地点
     */
    @Excel(name = "检测地点")
    @TableField(value = "testing_location")
    private String testingLocation;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        NucleicAcid other = (NucleicAcid) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDetectionResult() == null ? other.getDetectionResult() == null : this.getDetectionResult().equals(other.getDetectionResult()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getTestingLocation() == null ? other.getTestingLocation() == null : this.getTestingLocation().equals(other.getTestingLocation()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDetectionResult() == null) ? 0 : getDetectionResult().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getTestingLocation() == null) ? 0 : getTestingLocation().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", detectionResult=").append(detectionResult);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", userId=").append(userId);
        sb.append(", testingLocation=").append(testingLocation);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}